package com.gking.centerSystem.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gking.centerSystem.AOP.annotationUtil.desensitizeData.DesensitizeData;
import com.gking.centerSystem.AOP.annotationUtil.desensitizeData.SensitizedTypeEnum;
import com.gking.centerSystem.common.Result;
import com.gking.centerSystem.entity.dto.PagingQueryAiServiceRecordDto;
import com.gking.centerSystem.service.AiServiceRecord.AiServiceRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/aiServiceRecord")
public class AiServiceRecordController {

    @Resource
    private AiServiceRecordService aiServiceRecordService;


    /**
     * 获取AI服务记录分页列表
     *
     * @param page         分页页码
     * @param size         分页大小
     * @param conditionDto 条件
     * @return l
     */
    @DesensitizeData({
            @DesensitizeData.Field(field = "account", type = SensitizedTypeEnum.PREFIX),
            @DesensitizeData.Field(field = "accessUserId", type = SensitizedTypeEnum.COMMON),
    })
    @RequiresPermissions("CS:manager:query:aiService")
    @PostMapping("/getPageAiServiceRecordList")
    public Result<Page> getPageLogsRecordList(@RequestParam Integer page, @RequestParam Integer size,
                                              @RequestBody PagingQueryAiServiceRecordDto conditionDto) {
        return aiServiceRecordService.getRecordList(page, size, conditionDto);
    }
}
